<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul,li {
            list-style: none;
        }
        .box1 {
            max-width: 1320px;
            height: 404px;
            margin: 100px auto;
        }
        ul {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr;
            grid-template-rows: 404px;
            gap: 8px;
            transition: all 0.3s;
            overflow: hidden;
        }
        
        .item {
            position: relative;
            background: url(./img/1.png) no-repeat 50%/cover;
        }
        p {
            position: absolute;
            left: 0px;
            bottom: -100px;
            color: black;
        }
        .box1 li:hover p {
            position: absolute;
            left: 10px;
            bottom: 10px;
        }
        li:nth-child(2) {
            background-image: url(./img/微信图片_20251102212002_20_31.jpg);
        }
        li:nth-child(3) {
            background-image: url(./img/微信图片_20251102211951_19_31.jpg);
        }
        li:nth-child(4) {
            background-image: url(./img/cat.jpg);
        }

        .box1 ul:has(.item:nth-child(1):hover) {
            grid-template-columns: 2fr 1fr 1fr 1fr;
        }
        .box1 ul:has(.item:nth-child(2):hover) {
            grid-template-columns: 1fr 2fr 1fr 1fr;
        }
        .box1 ul:has(.item:nth-child(3):hover) {
            grid-template-columns: 1fr 1fr 2fr 1fr;
        }
        .box1 ul:has(.item:nth-child(4):hover) {
            grid-template-columns: 1fr 1fr 1fr 2fr
        }
    </style>
</head>
<body>
    <div class="box1">
        <ul>
            <li class="item">
                <p>1</p>
            </li>
            <li class="item">
                <p>2</p>
            </li>
            <li class="item">
                <p>3</p>
            </li>
            <li class="item">
                <p>4</p>
            </li>
        </ul>
    </div>
</body>
</html>